﻿<Window x:Class="RL.wStationMoneyTable"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Вокзальная ведомость" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:my="clr-namespace:RL" Loaded="Window_Loaded" d:DesignHeight="494" d:DesignWidth="761" SizeToContent="WidthAndHeight" Closing="Window_Closing">
    <Window.Resources>
        <CollectionViewSource x:Key="vokzalTableViewSource" d:DesignSource="{d:DesignInstance my:VokzalTable, CreateList=True}" />
        <CollectionViewSource x:Key="routeSource"/>
        <CollectionViewSource x:Key="stationSource" />
        <CollectionViewSource x:Key="departureSource" />
        <my:RouteListTypeConverter x:Key="RouteListTypeConverter"/>
        
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="35" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Name="stackPanel1" Orientation="Horizontal">
            <Button Content="OK" Height="23" Name="buttonSave" Width="75" Click="buttonSave_Click" />
        </StackPanel>
        <Grid DataContext="{StaticResource vokzalTableViewSource}" Grid.Row="1" HorizontalAlignment="Left" Margin="36,17,0,0" Name="grid1" VerticalAlignment="Top">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Label Content="Дата:" Grid.Column="2" Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            <TextBox Grid.Column="1" Grid.Row="0" Height="23" HorizontalAlignment="Left" Margin="3" Name="numdocTextBox" Text="{Binding Path=numdoc, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" VerticalAlignment="Center" Width="120" />
            <DatePicker Grid.Column="3" Grid.Row="0" Height="25" HorizontalAlignment="Left" Margin="3" Name="datedocDatePicker" SelectedDate="{Binding Path=datedoc, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" VerticalAlignment="Center" Width="115" />
            <Label Content="Номер:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            
            <Label Content="Путевой лист:" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            <StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="1">
                <TextBlock Height="23" HorizontalAlignment="Left" Margin="3,3,0,3" Name="id_routelistTextBox" Text="{Binding Path=id_routelist, Converter={StaticResource RouteListTypeConverter}, Mode=OneWay}" VerticalAlignment="Center" Width="180" />
               
                <Button Height="25" Width="25" Content="..." Name="SelectRouteListButton" Click="SelectRouteListButton_Click"/>
            </StackPanel>
            <my:ucSelectRLByNumber Grid.Column="1" Grid.Row="2" x:Name="FindRL" RouteListID="{Binding Path=id_routelist, Mode=TwoWay}"/>
            <Label Content="Автостанция:" Grid.Column="0" Grid.Row="3" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            <ComboBox Grid.Column="1" Grid.Row="3" ItemsSource="{Binding Source={StaticResource stationSource}}" DisplayMemberPath="name" SelectedValuePath="id" SelectedValue="{Binding Path=id_station, Mode=TwoWay}" IsSynchronizedWithCurrentItem="False"/>
            
            <Label Content="Маршрут:" Grid.Column="0" Grid.Row="4" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            <TextBox Grid.Column="3" Grid.Row="1" Height="23" HorizontalAlignment="Left" Margin="3" Name="time_departureTextBox" Text="{Binding Path=time_departure, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" VerticalAlignment="Center" Width="120" LostFocus="time_departureTextBox_LostFocus" />
            
            <!--<TextBox Grid.Column="1" Grid.Row="2" Height="23" HorizontalAlignment="Left" Margin="3" Name="id_routeTextBox" Text="{Binding Path=id_route, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" VerticalAlignment="Center" Width="120" />-->
            <ComboBox Grid.Column="1" Grid.Row="4" ItemsSource="{Binding Source={StaticResource routeSource}}" DisplayMemberPath="number" SelectedValuePath="id" SelectedValue="{Binding Path=id_route, Mode=TwoWay}" IsSynchronizedWithCurrentItem="False"/>
            
            <Label Content="Время выхода:" Grid.Column="2" Grid.Row="1" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            
            <Label Content="Количество билетов:" Grid.Column="0" Grid.Row="7" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            <TextBox Grid.Column="1" Grid.Row="7" Height="23" HorizontalAlignment="Left" Margin="3" Name="qnt_ticketsTextBox" Text="{Binding Path=qnt_tickets, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" VerticalAlignment="Center" Width="120" TextChanged="qnt_ticketsTextBox_TextChanged" />
            <Label Content="Стоимость билетов:" Grid.Column="2" Grid.Row="7" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            <TextBox Grid.Column="3" Grid.Row="7" Height="23" HorizontalAlignment="Left" Margin="3" Name="summa_ticketsTextBox" Text="{Binding Path=summa_tickets, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" VerticalAlignment="Center" Width="120" />
            <Label Content="Багаж:" Grid.Column="0" Grid.Row="9" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            <TextBox Grid.Column="1" Grid.Row="9" Height="23" HorizontalAlignment="Left" Margin="3" Name="bagazhTextBox" Text="{Binding Path=bagazh, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" VerticalAlignment="Center" Width="120" />
            <Label Content="Кол-во льгот. бил.:" Grid.Column="0" Grid.Row="10" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            <TextBox Grid.Column="1" Grid.Row="10" Height="23" HorizontalAlignment="Left" Margin="3" Name="qnt_lgot_ticketTextBox" Text="{Binding Path=qnt_lgot_ticket, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" VerticalAlignment="Center" Width="120" />
            <Label Content="Сумма льготных билетов:" Grid.Column="2" Grid.Row="10" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            <TextBox Grid.Column="3" Grid.Row="10" Height="23" HorizontalAlignment="Left" Margin="3" Name="summ_lgot_ticketTextBox" Text="{Binding Path=summ_lgot_ticket, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" VerticalAlignment="Center" Width="120" />
            <Label Content="Количество детских бил.:" Grid.Column="0" Grid.Row="12" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            <TextBox Grid.Column="1" Grid.Row="12" Height="23" HorizontalAlignment="Left" Margin="3" Name="qnt_child_ticketTextBox" Text="{Binding Path=qnt_child_ticket, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" VerticalAlignment="Center" Width="120" />
            <Label Content="Сумма детских билетов:" Grid.Column="2" Grid.Row="12" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            <TextBox Grid.Column="3" Grid.Row="12" Height="23" HorizontalAlignment="Left" Margin="3" Name="summ_child_ticketTextBox" Text="{Binding Path=summ_child_ticket, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" VerticalAlignment="Center" Width="120" />
            <Label Content="Сумма беспл. билетов:" Grid.Column="0" Grid.Row="14" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            <TextBox Grid.Column="1" Grid.Row="14" Height="23" HorizontalAlignment="Left" Margin="3" Name="summ_free_ticketTextBox" Text="{Binding Path=summ_free_ticket, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" VerticalAlignment="Center" Width="120" />
            <Label Content="Вед-ть недействительна:" Grid.Column="2" Grid.Row="15" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            <Label Content="страх. сбор:" Grid.Column="0" Grid.Row="15" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
            <TextBox Grid.Column="1" Grid.Row="15" Height="23" HorizontalAlignment="Left" Margin="3" Name="sum_insuaranceTextBox" Text="{Binding Path=sum_insurance, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" VerticalAlignment="Center" Width="120" />
            <CheckBox Content="" Grid.Column="3" Grid.Row="15" Height="16" HorizontalAlignment="Left" IsChecked="{Binding Path=del, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" Margin="3" Name="delCheckBox" VerticalAlignment="Center" />
        </Grid>
    </Grid>
</Window>
